feat(export): add combined project, model and agent reporting - #1713
Conversation
roborev: Combined Review (
|
roborev: Combined Review (
|
Independent project, model and agent totals cannot answer combined filters. Add opt-in reporting v3 with session-free five-minute cells, cost provenance and project-key selection. Use the shared Activity interval engine so these facts follow the same activity rules as the report. Select usage survivors and allocate authoritative costs before filtering projects. Bind complete cell sets and scope into each hour digest so late corrections replace prior usage instead of adding another charge. Retain the device bucket peak to keep aggregate concurrency bounds useful. Keep existing v1/v2 contracts and the v2 default unchanged. Document the replacement and precision limits, and measure the extra aggregation and payload cost with a synthetic SQLite benchmark.
Reporting integrations need to choose their time precision without changing the hourly publication cadence. Accept whole-minute durations that divide an hour, declare the resolution in v3 documents and bind it to their content identity. Preserve the v1/v2 bytes and the independent inactivity-gap rule. Keep standalone usage unattributed even when a real session has an empty project label. A missing session must not borrow that project's identity or contribute to its scoped totals. Compare one- and five-minute exports on the same synthetic archives so finer precision has a measured aggregation and payload cost.
b567745 to
7dac973
Compare
roborev: Combined Review (
|
Joint exports grouped sessions by their automation flag alone, merging subagent minutes, peaks and usage into interactive or automated cells. Use the activity classifier for both interval grouping and usage labels so delegation takes precedence and matching subagents share their own cell.
roborev: Combined Review (
|
Usage recorded after a session's activity range comes through a separate session query. That query omitted delegation metadata, so joint exports labeled subagents as interactive or automated despite the shared classifier. Load the relationship flag with usage sessions so their labels retain subagent precedence even when no activity falls in the reporting period.
Windows CI observed a successful response in the timeout case. The test used competing wall-clock timers, leaving deadline assertions dependent on host scheduling. Advance the deadline and handler delay with Go's virtual clock while retaining the response status, headers and body checks. Join the handler before leaving the clock bubble after a timeout response.
roborev: Combined Review (
|
Reporting exports can preserve project, model and agent relationships at a chosen time resolution. Separate breakdowns cannot answer questions such as "how much did this model cost on this project?" Opt-in reporting schema 4 supplies those combined facts without session identifiers, messages or tool content.
--project-keyselection and--bucket, such as1m,5mor15m. Any positive whole-minute duration that divides an hour is valid. Five minutes remains the default; v4 documents declarebucket_seconds. Schema 3 remains the default and keeps its existing bytes and digests. Versions 1 and 2 are no longer supported.The synthetic SQLite benchmark compares one- and five-minute exports with overlapping sessions, model switches and two project counts. This adds aggregation and payload cost, not incremental history discovery: digest screening still computes full day exports.
The timeout-response test uses virtual time and waits for its handler to finish, removing its dependence on host scheduling.